package com.lik888.web1.service.impl;


import com.lik888.web1.constants.UserContext;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Service;

@Service("check")
public class PreAuthorizeService {
    //判断是否是当前用户
    public Boolean isSelf (Authentication authentication) {
        //
        Long userId = (Long) authentication.getPrincipal();
        System.out.println(userId);
        return userId.equals(UserContext.getUser());
    }
}
